<%--
  Created by IntelliJ IDEA.
  User: tugou
  Date: 2017/4/26
  Time: 16:33
  To change this template use File | Settings | File Templates.
--%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta charset="UTF-8">
    <title>驾校预约</title>
    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/wapstyle.css">
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" name="viewport" id="viewport">
    <script src="<%=basePath%>js/jquery.min.js"></script>
    <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
    <script>
        var wxConfig = false;
        var obj = new Object();
        obj.url = window.location.href;
        function wxJsSdkInit() {
            $.post("<%=basePath%>wechat/sdkInit", obj, function (data) {
                wx.config({
                    appId: data.appid,
                    timestamp: data.timestamp,
                    nonceStr: data.nonceStr,
                    signature: data.signature,
                    jsApiList: ['openLocation']
                });
                wx.ready(function () {
                    wxConfig = true;
                });
            });
        }
        /**
         * 预约学车
         */
        wxJsSdkInit();
        function bookIng(locId) {
            $(".quanbrenbao").show().find(".datano").click(function () {
                 $(this).parents(".quanbrenbao").hide();
            });
            $(".datayes").click(function(){
                location.href="<%=basePath%>student/bespeakSchool/"+locId;
            });
        }
        /*
         * 导航
         * */
        function navigation(x,y,areName,locationName) {
            wx.openLocation({
                latitude: x, // 纬度，浮点数，范围为90 ~ -90
                longitude: y, // 经度，浮点数，范围为180 ~ -180。
                name: areName, // 位置名
                address:locationName, // 地址详情说明
                scale: 26, // 地图缩放级别,整形值,范围从1~28。默认为最大
                infoUrl: '' // 在查看位置界面底部显示的超链接,可点击跳转
            });
        }
    </script>
</head>
<body>
<div style="position: relative">
    <h2 class="header">驾校场地 </h2>
    <a style="position: absolute;right: 0;top: 12px;width: 80px;color: white;padding: 5px;font-size: 17px"
       href="tel:66655980"><img
            style="width: 21px; height: 20px; display: inline-block;margin-right: 5px;margin-top: -1px;"
            src="<%=basePath%>images/servicePhone.png"/>客服</a>
</div>
<div class="cdlist">
    <ul>
        <c:forEach var="loc" items="${locationList}">
        <li>
            <em>${loc.areaname}</em>
            <p class="zhutu"><img src="<%=basePath%>${loc.bgPicture}"></p>
            <h5>地址：${loc.locationname}</h5>
            <p class="yul">
                <a href="#" href="javascript:void(0);" class="yeyue" onclick="bookIng('${loc.id}')">
                    <img src="<%=basePath%>images/icon_yuy.png" id="${loc.id}">预约到此学车
                </a>
                <a href="javascript:void(0)" onclick="navigation(${loc.locationX},${loc.locationY},'${loc.areaname}','${loc.locationname}')">
                    <img src="<%=basePath%>images/icon_map.png">导航
                </a>
            </p>
        </li>
        </c:forEach>
    </ul>
</div>
<div class="quanbrenbao" >
    <div class="data_fon">
        <h2>是否到此学车</h2>
        <p><span class="datayes">确定</span> <span class="datano">取消</span></p>
    </div>
</div>
<%--<script type="text/javascript">
    $(".yeyue").click(function(){$(".quanbrenbao").show().find(".datano").click(function(){ $(this).parents(".quanbrenbao").hide();});; });
    $(".datayes").click(function(){
        location.href="<%=basePath%>student/bespeakSchool/1";
    });
</script>--%>
</body>
</html>
